<template>
  <!--操作盘点  唐美莉 -->
  <section>
    <table border="0" width="100%" style="border-spacing: 0;border-collapse: collapse;">
      <tr>
        <td>
          <el-form :inline="true">
            <el-form-item>
                <el-input v-model="form.vagueKey" clearable></el-input>
            </el-form-item>
            <el-form-item>
              <el-button type="primary" circle icon="el-icon-search" @click="getData(-1)"></el-button>
            </el-form-item>
            <!-- <el-form-item>
              <el-button type="primary" :disabled="!qxBtns.add" plain @click="addDurg(null)">+添加</el-button>
            </el-form-item> -->
          </el-form>
        </td>
        <td style="text-align:right;vertical-align: top;">
          <el-button @click="exportExcel()" :disabled="!qxBtns.export" plain>导出</el-button>
        </td>
      </tr>
    </table>
    <table class="table-box">
      <thead>
        <tr>
          <th>商品名称</th>
          <th>规格</th>
          <th>单位</th>
          <th>生产厂商</th>
          <th>供应商</th>
          <th>批号</th>
          <th>有效期</th>
          <th>账面数量</th>
          <th>实际数量</th>
          <th>盘盈盘亏</th>
        </tr>
      </thead>
      <tbody>
        <tr v-for="(item,index) in tableList" :key="index">
          <td>{{item.stockCode}}</td>
          <td>{{item.putInStorageDate}}</td>
          <td>{{item.inOutWay | changeAssist(typeList)}}</td>
          <td>{{item.supplierName }}</td>
          <td>{{item.memberName}}</td>
          <td>{{item.status==1?"正常":"待审核"}}</td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
        </tr>
      </tbody>
    </table>
    <div v-if="tableList.length == 0" style="color:#999;padding:10px 0;text-align:center;">
      <i class="iconfont iconwushuju" style="font-size:40px;"></i>
      <div>暂无数据</div>
    </div>
    <br />
    <pager v-model="pager" @change-pagenum="getData"></pager>
    <!-- <set v-model="dialogEdit" :curItem="curItem" @success="getData"></set> -->
  </section>
</template>
<script>
import Excel from "@/_js/excel.js";
import { debuglog } from "util";
export default {
  name: "storageList",
  data() {
    return {
      dialogJoin: false,
      dialogEdit: false,
      curItem: null,
      pager: { pageSize: 10, pageNum: 1, total: 0 },
      tableList: [],
      form: {
        hpId: "",
        type:1,
        numType:1,
        vagueKey: "" //名称
      },
      typeList: [],
      qxBtns: {},
      dataList: [],
      distype: "2",
      setType: "1"
    };
  },
  created() {
    let th = this;
    th.form.hpId = th.adminUser.hpId;
    th.getQX();
    th.getData();
    th.getBasicData();
    th.form.putInStorageStartTime=th.getDate(0);
    th.form.putInStorageEndTime=th.getDate(1);
  },
  methods: {
    onJoin(obj) {
      this.dialogJoin = true;
      this.curItem = obj;
    },
    getData(type, id) {
    },
    getBasicData() {
    },
    addDurg(obj){
        let th = this;
        let j = {};
        if (obj != null) {
          j = {
            id: th.jiaMi(obj.id)
          };
        } else {
          j = {
            id: th.jiaMi(0)
          };
        }
        th.$router.push({
          path: "/page/editInventory",
          query: th.getUrlToken(j)
        });
    },
  },
  components: {
  }
};
</script>
